<template>
  <div>
    <button @click="modifyType(true)">第一个组件</button>
    <button @click="modifyType(false)">第二个组件</button>
    <component :is="type?Index1:Index2" />
  </div>
</template>

<script setup>
import { reactive, ref, toRefs } from 'vue';
import Index1 from '../../components/sanDianEr/动态组件/index1.vue'
import Index2 from '../../components/sanDianEr/动态组件/index2.vue'
let type = ref(true)
let modifyType = (cb) => {
  type.value = cb
}

</script>
<style scoped lang ='less'>
</style>